/** WPI CS509 cisco Stratego logout reply message
 * 
 */
package edu.wpi.cs509.messages.client;

/**
 * This abstract class adds general ack info to reply message classes. 
 * This returns a boolean indicating a good/bad reply to the original message.
 * An error string is also provided.
 * @author sparadis
 *
 */
public abstract class MsgAckReply extends MsgClientContext {

	/**
	 * serializable version number
	 */
	private static final long serialVersionUID = 1L;
	
	/** 
	 * success  - true if the requesting message executed cleanly.
	 * errorStr - if !success, string containing the error that occurred.
	 */
	private boolean success;
	private String  errStr;
	
	/**
	 * Constructor.
	 * @param success: true if the requesting message executed cleanly.
	 * @param errStr:  if !success, string containing the error that occurred.
	 */
	public MsgAckReply(boolean success, String errStr) {
		this.success = success;
		this.errStr  = errStr;
	}
	
	/**
	 * Get the ack result.
	 * @return  true for a good acknowledge, false otherwise.
	 */
	public boolean msgSucceeded() {
		return success;
	}
	
	/**
	 * Get the error string.
	 * @return : the error string.
	 */
	public String getErrString() {
		return this.errStr;
	}

}
